#!/usr/bin/python
# -*- coding: UTF-8 -*-
# @author:qiaofinn
# @file:permission.py
# @time:2020/09/09

from rest_framework import permissions


class IsMemberUser(permissions.BasePermission):
    def has_permission(self, request, view):
        if not request.user or not request.user.is_authenticated:
            return False
        return request.user.is_member()
